/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package processer;

import main.BotManager;
import utils.Debug;

/**
 *
 * @author Administrator
 */
public class Logger extends Processer {

    public Logger(RoBot parent, GameData gameData, BotManager manager) {
        super(parent, gameData, manager);
    }

    @Override
    public void processMesage(String[] part) {
        super.processMesage(part);
        if (part[0].equals("LO")) {
            if (Integer.parseInt(part[1]) == 1) {
                gameData.setMyGender(Integer.parseInt(part[2]));
                gameData.setMyName(parent.userName);
                gameData.setMyMoney(Integer.parseInt(part[3]));
                parent.request.setMyName(parent.userName);
                return;
            }

            if (Integer.parseInt(part[1]) == 0) {
                Debug.d(
                        "Tài khoản này không tồn tại");
                return;
            }
            if (Integer.parseInt(part[1]) == 2) {
                Debug.d(
                        "mat khau ko dung");
                return;
            }
        }
        if (part[0].equals("SMSINFO")) {
            parent.changeProcesser(RoBot.GAME_CHOOSER);
            return;
        }

    }

    @Override
    public void doLoop() {
    }
}
